const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
//用户道具背包物品表
const UserGoodsSchema = new Schema({
    user: {//用户
        type: ObjectId,
        ref: "users"
    },
    goods: {//物品
        type: ObjectId,
        ref: "goods"
    },
    price_type: {
        type: Number, //0金币 1钻石
        default: 0
    },
    price: {
        type: Number,
        default: 0
    },
    count: {  //数量
        type: Number,
        default: 1
    },
    created_at: {
        type: Date,
        default: new Date()
    }
});



module.exports = User_Good = mongoose.model("usergoods", UserGoodsSchema);